#include <reg52.h>
#define uint unsigned int
#define uchar unsigned char

void main()
{
	uchar temp;
	while(1)
	{
		P0=0xff;
		temp=P0;
		temp=temp&0x07;
		switch(temp)
		{
			case 0:P1=0xfe;break;
			case 1:P1=0xfd;break;
			case 2:P1=0xfb;break;
			case 3:P1=0xf7;break;
			case 4:P1=0xef;break;
			case 5:P1=0xdf;break;
			case 6:P1=0xbf;break;
			case 7:P1=0x7f;break;
		}
	}
}